<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>{$Think.lang.rpl_edit_page_title} - {$Think.lang.cfg_website}</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-metro.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/themes/{:session('skin')}.css" rel="stylesheet" type="text/css" id="style_color"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN PAGE LEVEL STYLES -->
	<!-- END PAGE LEVEL STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<include file="Public:header" />
	<!-- END HEADER -->
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<div class="page-sidebar nav-collapse collapse">
			<!-- BEGIN SIDEBAR MENU -->        
			<ul class="page-sidebar-menu">
            	<li>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
					<div class="sidebar-toggler hidden-phone"></div>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
				</li>
               {$menu_tree}
            </ul>
			<!-- END SIDEBAR MENU -->
		</div>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="portlet-config" class="modal hide">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button"></button>
					<h3>portlet Settings</h3>
				</div>
				<div class="modal-body">
					<p>Here will be a configuration form</p>
			  </div>
			</div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTAINER-->
			<div class="container-fluid">
				<!-- BEGIN PAGE HEADER-->   
			  <div class="row-fluid">
					<div class="span12">
                    	<div class="clear">&nbsp;</div>                        
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="__APP__">{$Think.lang.cfg_page_home}</a> 
								<span class="icon-angle-right"></span>
							</li>
							<li>
								<a href="__URL__">{$Think.lang.rpl_page_title}</a> 
								<span class="icon-angle-right"></span>
						  </li>
							<li><a href="#">{$Think.lang.rpl_edit_page_title}</a></li>
						</ul>
					</div>
				</div>
				<!-- END PAGE HEADER-->
				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN VALIDATION STATES-->
						<div class="portlet box purple">
							<div class="portlet-title">
								<div class="caption"><i class="icon-plus"></i>{$Think.lang.rpl_edit_page_title}</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
								</div>
							</div>
							<div class="portlet-body form">
									<div class="alert alert-error hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_err_allform}
									</div>
									<div class="alert alert-success hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_ok_allform}
									</div>
                                    <div class="tabbable tabbable-custom">
                                        <ul class="nav nav-tabs">
                                            <li class="active">
                                                <a href="#tab_1_1" data-toggle="tab">
                                                    {$Think.lang.cfg_form_tab_wechat_reply}
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#tab_1_2" data-toggle="tab">
                                                    {$Think.lang.rpl_form_tab_content_set}
                                                </a>
                                            </li>
                                        </ul>
                                        <div class="tab-content">
                                        <!--tab1 start-->
                                        <div class="tab-pane active" id="tab_1_1">
                                          <div class="alert alert-tip">
                                              <button class="close" data-dismiss="alert"></button>
                                              {$Think.lang.rpl_form_tip_content}<br/>
                                           	  {$Think.lang.rpl_form_tip_reply}
                                          </div>
                                        <form action="__URL__/edit" method="post" id="adcontentForm" 
                                 		 class="form-horizontal form-bordered form-row-stripped">
                                 		 <input type="hidden" name="reply_solevar" value="{$reply.reply_solevar}" />
                                 		 <input type="hidden" name="id"            value="{$reply.id}"/>
                                        	 <div class="control-group">
                                                <label class="control-label">{$Think.lang.cfg_form_reply_type}
                                                <span class="required">*</span></label>
                                                <div class="controls">
                                                    <select name="retype" id="retype" class="span6 m-wrap">
                                                   {$retype}
                                                    </select>
                                                </div>
                                            </div>
                                        
                                        	<div class="control-group">
                                                <label class="control-label">{$Think.lang.cfg_form_wechat_reply_type}
                                                <span class="required">*</span></label>
                                                <div class="controls">
                                                    <select name="type" id="type" class="span6 m-wrap">
                                                   <option value="">{$Think.lang.cfg_form_tis_select}</option>
                                                   {$type}
                                                    </select>
                                                </div>
                                            </div>
                                            <div id="reply_content">
                                            </div>
                                            <div id="event_content">
                                            </div>
                                            
                                            <div class="form-actions">
                                                <button type="submit" class="btn purple">{$Think.lang.cfg_form_ele_submit}</button>
                                                <button type="reset" class="btn">{$Think.lang.cfg_form_ele_reset}</button>
                                            </div>
                                            </form>
                                        </div>
                                        <!--tab1 end-->
                                        <!--tab2 start-->
                                        <div class="tab-pane" id="tab_1_2">
                                          <form action="__URL__/sort" method="post" id="sortFrom" 
                                         	class="form-horizontal form-bordered form-row-stripped">
                                            <input type="hidden" name="id"            value="{$reply.id}"/>
                                            <div class="alert alert-tip">
                                              <button class="close" data-dismiss="alert"></button>
                                              {$Think.lang.rpl_form_tip_content}<br/>
                                           	  {$Think.lang.rpl_form_tip_reply}
                                           </div>
                                       		<div class="row-fluid">
                                              <div class="span6">
                                                <button type="button" id="btn_addContent" class="btn blue">
                                                	<i class="icon-plus"></i>
                                                    {$Think.lang.rpl_form_btn_addcontent}
                                                </button>
                                                <button type="button" id="btn_refresh" class="btn green  icn-only">
                                                <i class="icon-refresh"></i>
                                            	</button>
                                              </div>
                                            </div>
                                            <div class="clear" style="height:10px;"></div>
                                            <table class="table table-striped table-bordered table-hover 
                                             table-condensed flip-content">
                                                <thead>					
                                                <tr class="list_head ct" style="text-align:center">
                                                 <td width="70">{$Think.lang.rpl_form_list_content_order}</td>
                                                  <td >{$Think.lang.rpl_form_list_content_type}</td>
                                                  <td >{$Think.lang.rpl_form_list_content_name}</td>
                                                  <td >{$Think.lang.cfg_form_ele_opreate}</td>
                                                </tr>
                                                </thead>
                                                <tbody id="tableList">
                                                
                                                </tbody>
                                                <eq name="reply.retype" value="news">
                                                <tfoot>
                                                  <tr class="tr">
                                                    <td colspan="4" valign="middle">
                                                      <button type="submit" class="btn blue">
                                                          <i class="icon-sort-by-order"></i>
                                                          {$Think.lang.rpl_form_ele_sort}
                                                      </button>
                                                    </td>
                                                  </tr>
                                                  </tfoot>
                                                  </eq>
                                            </table>   
                                            </form>     
                                        </div>
                                        <!--tab2 end-->
                                    </div>
                                    </div>

							</div>
						</div>
						<!-- END VALIDATION STATES-->
					</div>
                    <!-- UploadPic STATES -->

				</div>
				<!-- END PAGE CONTENT-->         
		  </div>
			<!-- END PAGE CONTAINER-->
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<include file="Public:footer" />
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->
	<script src="__PUBLIC__/Js/jquery.min.js" type="text/javascript"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>    
	<script src="{$NOW_THEME_URL}/Assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<!--[if lt IE 9]>
	<script src="{$NOW_THEME_URL}/Assets/plugins/excanvas.min.js"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/respond.min.js"></script>  
	<![endif]-->
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<!-- END CORE PLUGINS -->
    
    <!-- BEGIN UPLOADPIC-->
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/jquery.artdialog.js?skin=bootstrap"></script>
	<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/plugins/iframeTools.js"></script>
    <!-- END UPLOADPIC-->
    
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/jquery-validation/localization/messages_{$Think.LANG_SET}.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
  
    <!-- BEGIN XHEDITOR-->
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/xheditor/xheditor-1.2.1.min.js"></script>
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/xheditor/xheditor_lang/{$Think.LANG_SET}.js"></script>
    <!-- END XHEDITOR-->
    
    <!-- BEGIN PAGE LEVEL STYLES -->
	<script src="{$NOW_THEME_URL}/Assets/scripts/app.js"></script>
    <script src="{$NOW_THEME_URL}/Assets/scripts/wechat/set.js"></script>
    <script src="{$NOW_THEME_URL}/Assets/scripts/wechat/content_list.js"></script>
    <script src="{$NOW_THEME_URL}/Assets/scripts/wechat/add.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=023ea5aa58d31c2d2dc6a650bad7795b"></script> 
    <script type="text/javascript" src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script> 
    <script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.4/src/SearchInfoWindow_min.js"></script>
	<!-- END PAGE LEVEL STYLES -->    
	<script type="text/javascript">
		var ABS_URL_Theme = "{$NOW_THEME_URL}/";
		//UploadPic STATES CONSTANT
		var ABS_URL = "{$Think.TMPL_URL}/";
		var REL_URL = "{$Think.REL_URL}";
		//UploadPic END CONSTANT
		
		var vMessage = {};
		vMessage.retype_required   = '{$Think.lang.rpl_form_validata_retype_required }';
		vMessage.type_required     = '{$Think.lang.rpl_form_validata_type_required }';
		
		var jsLang = {};
		
		jQuery(document).ready(function() {
		   	// initiate layout and plugins
		  	App.init();
		  	adcontentForm.init();
		  	
			$('#btn_addContent').on('click',function(){
				name =  "{$Think.lang.rpl_form_btn_addcontent}";
				var solevar = $('input[name=reply_solevar]').val(); 
				art.dialog.open('{:U("/Reply/content_list")}'+'&solevar='+solevar,
				{title: name, width:600,height:420,fixed:true,top:60});
			});
			
			var parameter = {};
			parameter.content_add_keywrods = '{:U("/Public/add_keywrods")}'+'&keywords='+'{$reply.keywords}';
			parameter.content_add_location = '{:U("/Public/content_add_location")}'+'&islocation='+'{$reply.islocation}&keywords='+'{$reply.keywords}';
			parameter.content_add_event    = '{:U("/Public/content_add_event")}'+'&event='+'{$reply.event_type}';
			parameter.content_add_menu     = '{:U("/Public/content_add_menu")}'+'&value='+'{$reply.event_value}';
		   	wechatSet.init(parameter);
			
			$('#btn_refresh').on('click',function(){
				getListReply();
			});
			
			$('.delAlone').live('click',function(){
				$.get('{:U("/Reply/delcont")}'+'&id='+$(this).attr('data-id'));
				getListReply();
			});
			getListReply();
		});
		
		function getListReply(){
			$('#tableList').html('<tr><td colspan="3"><div id="ajaxLoadingIco" style="text-align:center;padding:20px;">'+
								 '<img src="'+ABS_URL_Theme+'/Assets/img/ajax-loading.gif"/></div></td></tr>');
			
			var solevar = $('input[name=reply_solevar]').val(); 
			var parameter = {};
			parameter.url = '{:U("/Reply/reply_content_list")}'+'&solevar='+solevar;
			parameter.listId = 'tableList';
			wechatContentList.init(parameter);	
		}
		
		
	</script>

<script type="text/javascript">	
	jQuery(document).ready(function() {
		$('#type').val('{$reply.reply_type}');
		$('#type').change();
	});
</script>

	<!-- END JAVASCRIPTS -->   
</body>
<!-- END BODY -->
</html>